ENH: Add initial BCI2000 .dat reader (preload-only)#13699
ENH: Add initial BCI2000 .dat reader (preload-only)#13699HansujaB wants to merge 10 commits intomne-tools:mainfrom
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
larsoner
left a comment
There was a problem hiding this comment.
I didn't look too deeply at the code, but looks like a reasonable start! With something like this we'd want to see it used somewhere, too -- is there a good file we could download using pooch in an example and use in an examples/io/something.py or similar? We could do something like what's done here
Also did you use AI tools in developing this code? If so please disclose the nature of AI tool usage
| from mne.io.bci2k import RawBCI2k, read_raw_bci2k | ||
|
|
||
|
|
||
| def _write_demo_bci2k( |
There was a problem hiding this comment.
A more modern way to do this would be to
| def _write_demo_bci2k( | |
| @pytest.fixture | |
| def bci2k_path(tmp_path): | |
| fname = tmp_path / "something" | |
| ... | |
| return fname |
and then you use this inside your test
There was a problem hiding this comment.
@larsoner Thanks a lot for your review!
I searched for an example file but couldn't really find one, although I came across PhysioNet bigP3BCI dataset. The problem is , they converted .dat files to EDF + file header, so we can't use it !
What we can do is (use the same approach to generate a small example file) :
We can generate a small BCI2000 .dat file using a short P3Speller session with minimal channels and then host a trimmed version (a few seconds only) .
If this approach is acceptable I can work on it , Let me know!
Regarding AI usage , I looked upon the major stuff and algorithm development myself but for debugging and redundancy reduction, I took the help of AI tools to increase my efficiency!
Reference issue (if any)
Fixes #13151
What does this implement/fix?
This PR adds basic support for reading BCI2000
.datfiles via:The implementation:
StimulusCodetoSTI 014stim channelRawobject usingRawArrayTests
Synthetic
.datgenerator included in testsVerifies:
StimulusCodedecodingpreload=FalseraisesScope (Intentional Limitations)
preload=Falseis not supported (raisesNotImplementedError)EEG1,EEG2, …)_get_supported()(since.datis already mapped to Curry)The goal is to provide a correct, minimal reader that can be safely extended in follow-up PRs.